package com.djzhou.gmms.systeminfo.action;

import com.djzhou.gmms.base.action.BaseAction;
import com.djzhou.gmms.model.systeminfo.TbSystemInfo;
import com.opensymphony.xwork2.ModelDriven;

public class SystemInfoAction extends BaseAction<TbSystemInfo> implements ModelDriven<TbSystemInfo>{


	private Integer systemId;
	private TbSystemInfo systemInfo;
	
	@Override
	public String modify() {
		systemInfoService.update(systemInfo);
		systemId=systemInfoService.queryId();
		if(systemId!=null && systemId!=0)systemInfo=systemInfoService.queryById(systemId);
		logService.addLog("基础信息",queryUser(),"编辑",systemId,"TbSystemInfo",queryCompany(),super.queryDepartment());
		return SUCCESS;
	}

	@Override
	public String toEdit() {
		systemId=systemInfoService.queryId();
		if(systemId!=null && systemId!=0)systemInfo=systemInfoService.queryById(systemId);
		return SUCCESS;
	}
	
	public TbSystemInfo getModel() {
		return systemInfo;
	}

	public Integer getSystemId() {
		return systemId;
	}

	public void setSystemId(Integer systemId) {
		this.systemId = systemId;
	}

	public TbSystemInfo getSystemInfo() {
		return systemInfo;
	}

	public void setSystemInfo(TbSystemInfo systemInfo) {
		this.systemInfo = systemInfo;
	}

}
